﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace space_scavenger.Behavior
{
    class LineBehavior<T> : AbstractBehavior<T> where T : Entity
    {
        Vector2 direction;

        Vector2 velocity = Vector2.Zero;

        float speed = 0.0f;

        public LineBehavior(T owner, Vector2 direction, float speed)
            : base(owner)
        {
            this.direction = direction;
            this.speed = speed;
        }

        public override bool shouldMove(GameTime gameTime)
        {
            return true;
        }

        public override void doMove(GameTime gameTime)
        {
            velocity = Vector2.Normalize(direction) * speed;

            Behoover.Velocity = velocity;
        }
    }
}
